package com.hl.web.fore;

import com.hl.pojo.Certificate;
import com.hl.service.CertificateService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/certificate")
public class CertificateController {
    @Autowired
    private CertificateService certificateService;
    @RequestMapping("/add")
    public ResultEntity add(@RequestBody Certificate certificate){
        certificateService.add(certificate);
        return ResultEntity.ok();
    }
    @RequestMapping("/del")
    public ResultEntity del(Certificate certificate){
        certificateService.del(certificate);
        return ResultEntity.ok();
    }
    @RequestMapping("/findById")
    public ResultEntity findById(Certificate certificate){
        return ResultEntity.ok(certificateService.findById(certificate));
    }
    @RequestMapping("/findByConsultant")
    public ResultEntity findByConsultant(Certificate certificate){
        return ResultEntity.ok(certificateService.findByConsultant(certificate));
    }
}
